<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>position</title>

  <style>
    .box1 {
      width: 300px;
      height: 300px;
      background-color: lightsteelblue;

      position: relative;
    }

    .box2 {
      width: 300px;
      height: 300px;
      background-color: lightgreen;

      position: relative;
    }

    .item1 {

      width: 50px;
      height: 50px;
      background-color: lightgreen;

      position: absolute;

      top: 50px;
      left: 200px;
    }

    .item2 {

      width: 50px;
      height: 50px;
      background-color: rgb(172, 144, 238);

      position: absolute;

      top: 100px;
      left: 20px;
    }
  </style>
</head>

<body>

<p>互不影响</p>

  <div class="box1">
    <div class="item1"></div>
  </div>



  <div class="box2">

    <div class="item2"></div>
  </div>
</body>

</html>